import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter/material.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/TwoLabelItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/LeftLabelInputItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/SmsCodeItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/NavigationBar.dart';
import 'package:heyangkuaidai/DemonStrateModule/LoanSendConfirmPage.dart';
import 'package:heyangkuaidai/DemonStrateModule/SubscribeCancelPage.dart';
class PreLoanSendPage extends StatefulWidget {
  String money;
  String startEndDate;
  PreLoanSendPage({this.money,this.startEndDate});
  @override
  _PreLoanSendPageState createState() => _PreLoanSendPageState();
}

class _PreLoanSendPageState extends State<PreLoanSendPage> {
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 375, height: 667, allowFontScaling: true);
    String money = widget.money;
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Column(
        children: [
          SizedBox(height: MediaQuery.of(context).padding.top,),
          NavigationBar(false, title: "预放款",),
          Container(
              width: ScreenUtil.screenWidth,
              height: ScreenUtil.screenHeight-MediaQuery.of(context).padding.top-ScreenUtil().setWidth(70),
              child: ListView(
                padding: EdgeInsets.only(top: 0),
                children: [

                  TwoLabelItem(title:"借款金额" ,hitText:"$money元 " ,),
                  TwoLabelItem(title:"借款人姓名", hitText: "章*闯",),
                  TwoLabelItem(title:"身份证号", hitText: "430110********5648",),
                  TwoLabelItem(title:"年利率", hitText: "4.65%",),
                  TwoLabelItem(title:"起止时间 ", hitText: widget.startEndDate,),
                  TwoLabelItem(title:"贷款账号", hitText: "621416********165646",),
                  TwoLabelItem(title:"还款方式", hitText: "按月付息，到期还本",),
                  TwoLabelItem(title:"还款日", hitText: "每月21日",),
                  // LeftLabelInputItem(title: "借款用途",hitText: "请输入借款用途",showArrown: true,),
                  Column(
                    children: [
                      SizedBox(height: ScreenUtil().setWidth(23),),
                      InkWell(
                        onTap: (){
                          Navigator.push(
                            context,
                            new MaterialPageRoute(
                              builder: (context) => new LoanSendConfirmPage(money: money,startEndDate: widget.startEndDate,),
                            ),
                          );
                        },
                        child: Container(
                            decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(4),
                              color:Color(0xff41A5EE),
                            ),
                            width: ScreenUtil().setWidth(347),
                            height: ScreenUtil().setWidth(44),
                            child:Center(
                              child: Text("放款",style: TextStyle(fontSize: ScreenUtil().setSp(17),color: Colors.white),textAlign: TextAlign.center,),
                            )
                        ) ,
                      ),
                      SizedBox(height: ScreenUtil().setWidth(20),),
                      InkWell(
                        onTap: (){
                          Navigator.push(
                            context,
                            new MaterialPageRoute(
                              builder: (context) => new SubscribeCancelPage(),
                            ),
                          );
                        },
                        child: Container(
                            decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(4),
                                color:Color(0xffFFFFFF),
                                border: Border.all(
                                    color: Color(0xff41A5EE),
                                    width: 1,
                                    style: BorderStyle.solid
                                )
                            ),
                            width: ScreenUtil().setWidth(347),
                            height: ScreenUtil().setWidth(44),
                            child:Center(
                              child: Text("撤销",style: TextStyle(fontSize: ScreenUtil().setSp(17),color: Color(0xff41A5EE)),textAlign: TextAlign.center,),
                            )
                        ) ,
                      )
                    ],
                  )
                ],
              )
          ) ,


        ],
      ),
    );
  }
}
